|
![](/i/fill.gif) |
On Fri, 2 May 2003 14:15:13 +0200, "Jaap Frank" <jjf### [at] xs4all nl> wrote:
> I have a 3D-grid with density values in a 3D-array called
> Cube and must use this as density inside a media statement.
I assume using density file format is not possible in your case ?
Perhaps maps are the solution you are looking for. I mean array:
#local A=array[2][2];
#local A[0][0]=0;
#local A[0][1]=.1;
#local A[1][0]=.2;
#local A[1][1]=.3;
can be expressed as
#local C=array[2];
#local C[0]=pigment{
gradient y
pigment_map{
[0 color rgb A[0][0]]
[1 color rgb A[0][1]]
}
}
#local C[1]=pigment{
gradient y
pigment_map{
[0 color rgb A[1][0]]
[1 color rgb A[1][1]]
}
}
#local P=pigment{
gradient x
pigment_map{
[0 C[0]]
[1 C[0]]
}
}
and then
A[0,0]=P(0,0,0)
A[0,1]=P(0,1,0)
A[1,0]=P(1,0,0)
A[1,1]=P(1,1,0)
Of course this can be easy extended into 3 dimensions and coded with smart loops
but I would leave it for you because you are using 'advanced' group for post :-)
AVX
Post a reply to this message
|
![](/i/fill.gif) |